minister = jQuery.noConflict();
minister().ready(function() {
						  
minister("#portfolio-node-form").validate({
										
					rules: {
						'field_type_portfolio[und]': { 
							required: true,
							maxlength: 255,
							chkbadchar:true,
							valuenotequals: '_none',
						},
						'field_portfolio_member[und]': { 
							required: true,
							maxlength: 255,
							chkbadchar:true,
							valuenotequals: '_none',
						},
						
						'title': { 
							required: true,
							minlength: 5,
							maxlength: 255,
							chkbadchar:true,
							splchar:true,
						},
						
						'field_portfolio_portfolio[und][0][value]':{
							required: true,
							minlength: 5,
							maxlength: 255,
							chkbadchar:true,
							splchar:true,							
							},
														
						'field_portfolio_department[und][]':{
							required: true,
							multi_dist_select: true,
							},
							
						'field_portfolio_oder[und]':{
							required: true,
							maxlength: 255,
							chkbadchar:true,
							valuenotequals: '_none',						
							},
					
					},
                    messages: {
							'field_type_portfolio[und]':{
							required: 'Please Select Position',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar: 'insert, select, update, delete, drop, alter, change, modify not allowed.',
							valuenotequals: 'Please Select Position',
							},
							'field_portfolio_member[und]':{
							required: 'Please Select MLA',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar: 'insert, select, update, delete, drop, alter, change, modify not allowed.',	
							valuenotequals: 'Please Select MLA',
							},
							
							'title': { 
							required:  'Please enter Designation Details',
							minlength: 'Minimum 5 characters should be entered',
							maxlength: 'Maximum 255 character only allowed',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',
							splchar:'Special Characters are not allowed',
							},
							'field_portfolio_portfolio[und][0][value]':{
							required:  'Please Enter Portfolio',
							minlength: 'Minimum 5 characters should be entered',
							maxlength:  'Maximum 255 character only allowed',
							chkbadchar:'insert, select, update, delete, drop, alter, change, modify not allowed.',
							splchar:'Special Characters are not allowed',		
							
							},
							
							'field_portfolio_department[und][]':{							
							multi_dist_select: 'Please Select either All or Particular Department',
							},
							
							
							'field_portfolio_oder[und]':{							
							valuenotequals: 'Please Select Display Order',
							},
	
				}, 
					
   					invalidHandler: function(form, validator) {
       
       					 if (!validator.numberOfInvalids())
								return;
						else{
							
							  //minister("#portfolio-node-form").create_errormsg_container('errormsg_container','portfolio-node-form');
						}
							
							minister('html, body').animate({
								scrollTop: minister(validator.errorList[0].element).offset().top - 100
							}, 1000);
							
						},
   
	});
});
